import type { IcomponentList, TState } from "./type.ts";

import Announcement from "./components/Announcement.vue";
import Milestone from "./components/Milestone.vue";
import ProjectTeamMember from "./components/ProjectTeamMember.vue";
import ProjectDynamic from "./components/ProjectDynamic.vue";
import ProjectDetail from "./components/ProjectDetail.vue";
import Line from "./components/Line.vue";
import Pie from "./components/Pie.vue";
import Column from "./components/Column.vue";
import Radar from "./components/Radar.vue";
import Table from "./components/Table.vue";
import ProjectProgress from "./components/ProjectProgress.vue";
import Proportion from "./components/Proportion.vue";
import Distributed from "./components/Distributed.vue";
import Statistics from "./components/Statistics.vue";
import ResultStatistics from "./components/ResultStatistics.vue";
import FinishChart from "./components/FinishChart.vue";
import Detail from "./components/Detail.vue";

import Project from "@/views/project/index.vue";

export const Customcomponents = {
  Announcement,
  Milestone,
  ProjectTeamMember,
  ProjectDynamic,
  ProjectDetail,
  Line,
  Pie,
  Column,
  Radar,
  Table,
  ProjectProgress,
  Proportion,
  Distributed,
  Statistics,
  FinishChart,
  ResultStatistics,
  Detail,

  Project,
};

export const stateMap: Record<TState, string> = {
  browse: "查看",
  edit: "编辑",
  add: "添加",
};

export const componentList: Array<IcomponentList> = [
  {
    value: "基本信息",
    type: "ProjectDetail",
    icon: "",
  },
  {
    value: "公告",
    type: "Announcement",
    icon: "",
  },
  {
    value: "里程碑",
    type: "Milestone",
    icon: "",
  },
  {
    value: "项目成员",
    type: "ProjectTeamMember",
    icon: "",
  },
  {
    value: "项目动态",
    type: "ProjectDynamic",
    icon: "",
  },
  // {
  //   value: "Line",
  //   type: "Line",
  //   icon: "",
  // },
  // {
  //   value: "Pie",
  //   type: "Pie",
  //   icon: "",
  // },
  // {
  //   value: "Column",
  //   type: "Column",
  //   icon: "",
  // },
  // {
  //   value: "Radar",
  //   type: "Radar",
  //   icon: "",
  // },
  // {
  //   value: "Project",
  //   type: "Project",
  //   icon: "",
  // },

  // {
  //   value: "Table",
  //   type: "Table",
  //   icon: "",
  // },
  {
    value: "我的项目进展",
    type: "ProjectProgress",
    icon: "",
  },
  {
    value: "任务完成情况占比",
    type: "Proportion",
    icon: "",
  },
  {
    value: "任务完成情况分布",
    type: "Distributed",
    icon: "",
  },
  {
    value: "报告数据统计",
    type: "Statistics",
    icon: "",
  },
  {
    value: "仿真结果采纳统计",
    type: "ResultStatistics",
    icon: "",
  },
  {
    value: "任务燃尽图",
    type: "FinishChart",
    icon: "",
  },
  {
    value: "任务仿真明细",
    type: "Detail",
    icon: "",
  },
];

export const dragSourceMap = componentList.reduce((pre, element) => {
  (pre as any)[element.type] = element.value;
  return pre;
}, {});

export const titleMap: any = {
  globalShapeConfig: "全局配置",
  shapeConfig: "项目概览",
};
